ABC115 C - Christmas Eve
https://atcoder.jp/contests/abc115/tasks/abc115_c
提出
code: python
n, k = map(int, input().split())
h = sorted(
int(input()) for _ in range(n)
)
ans = float('inf')
for i in range(k-1, n):
res = h
i
- h
i-k+1
if (res < ans):
ans = res
print(ans)